<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>MiXiM: DummyRoute Class Reference</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>


</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">MiXiM
   &#160;<span id="projectnumber">2.3</span>
   </div>
   
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.5.1 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li><a href="dirs.html"><span>Directories</span></a></li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="classes.html"><span>Class&#160;Index</span></a></li>
      <li><a href="inherits.html"><span>Class&#160;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
    </ul>
  </div>
</div>
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
  initNavTree('a00089.html','');
</script>
<div id="doc-content">
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pro-methods">Protected Member Functions</a> &#124;
<a href="#pro-attribs">Protected Attributes</a>  </div>
  <div class="headertitle">
<div class="title">DummyRoute Class Reference<div class="ingroups"><a class="el" href="a00507.html">netwLayer - network layer modules</a></div></div>  </div>
</div>
<div class="contents">
<!-- doxytag: class="DummyRoute" --><!-- doxytag: inherits="BaseNetwLayer" -->
<p>Placeholder module that simply "translates" netwControlInfo to macControlInfo.  
 <a href="a00089.html#details">More...</a></p>

<p><code>#include &lt;<a class="el" href="a00448_source.html">DummyRoute.h</a>&gt;</code></p>
<div class="dynheader">
Inheritance diagram for DummyRoute:</div>
<div class="dyncontent">
<div class="center"><img src="a00738.png" border="0" usemap="#DummyRoute_inherit__map" alt="Inheritance graph"/></div>
<center><span class="legend">[<a target="top" href="graph_legend.html">legend</a>]</span></center></div>
<div class="dynheader">
Collaboration diagram for DummyRoute:</div>
<div class="dyncontent">
<div class="center"><img src="a00739.png" border="0" usemap="#DummyRoute_coll__map" alt="Collaboration graph"/></div>
<center><span class="legend">[<a target="top" href="graph_legend.html">legend</a>]</span></center></div>

<p><a href="a00740.html">List of all members.</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="abdee96cebdcaeef041d21f4dd8d90b9d"></a><!-- doxytag: member="DummyRoute::initialize" ref="abdee96cebdcaeef041d21f4dd8d90b9d" args="(int)" -->
virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00089.html#abdee96cebdcaeef041d21f4dd8d90b9d">initialize</a> (int)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Initialization of the module and some variables. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a0325921784a8180a35f51ec5cb1ece32"></a><!-- doxytag: member="DummyRoute::finish" ref="a0325921784a8180a35f51ec5cb1ece32" args="()" -->
virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00089.html#a0325921784a8180a35f51ec5cb1ece32">finish</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Called when the simulation has finished. <br/></td></tr>
<tr><td colspan="2"><h2><a name="pro-methods"></a>
Protected Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="afd462238bd49ed699157a22acc4b4d15"></a><!-- doxytag: member="DummyRoute::handleUpperMsg" ref="afd462238bd49ed699157a22acc4b4d15" args="(cMessage *msg)" -->
virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00089.html#afd462238bd49ed699157a22acc4b4d15">handleUpperMsg</a> (cMessage *msg)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Handle messages from upper layer. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a33f1e68f09911942c05a83bb913c9f30"></a><!-- doxytag: member="DummyRoute::handleLowerMsg" ref="a33f1e68f09911942c05a83bb913c9f30" args="(cMessage *msg)" -->
virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00089.html#a33f1e68f09911942c05a83bb913c9f30">handleLowerMsg</a> (cMessage *msg)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Handle messages from lower layer. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a605fd4a2cdab0ea03e85da319fe5195a"></a><!-- doxytag: member="DummyRoute::handleSelfMsg" ref="a605fd4a2cdab0ea03e85da319fe5195a" args="(cMessage *)" -->
virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00089.html#a605fd4a2cdab0ea03e85da319fe5195a">handleSelfMsg</a> (cMessage *)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Handle self messages. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="afd79fff68c38e01a4c52c13c06c65a9a"></a><!-- doxytag: member="DummyRoute::handleLowerControl" ref="afd79fff68c38e01a4c52c13c06c65a9a" args="(cMessage *msg)" -->
virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00089.html#afd79fff68c38e01a4c52c13c06c65a9a">handleLowerControl</a> (cMessage *msg)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Handle control messages from lower layer. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="abf11af5edec306f70e20231ad6280283"></a><!-- doxytag: member="DummyRoute::handleUpperControl" ref="abf11af5edec306f70e20231ad6280283" args="(cMessage *msg)" -->
virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00089.html#abf11af5edec306f70e20231ad6280283">handleUpperControl</a> (cMessage *msg)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Handle control messages from lower layer. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual <a class="el" href="a00028.html#a70ef917f412c70e361b698d6989e677f">netwpkt_ptr_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00089.html#a20ab170f205c2834e998b7bbf91043c0">encapsMsg</a> (cPacket *appPkt)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Encapsulate higher layer packet into an NetwPkt.  <a href="#a20ab170f205c2834e998b7bbf91043c0"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a04dfae1582e817482ed118d1325f082d"></a><!-- doxytag: member="DummyRoute::decapsMsg" ref="a04dfae1582e817482ed118d1325f082d" args="(netwpkt_ptr_t msg)" -->
virtual cPacket *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00089.html#a04dfae1582e817482ed118d1325f082d">decapsMsg</a> (<a class="el" href="a00028.html#a70ef917f412c70e361b698d6989e677f">netwpkt_ptr_t</a> msg)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Decapsulate a message. <br/></td></tr>
<tr><td colspan="2"><h2><a name="pro-attribs"></a>
Protected Attributes</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aea50195938376b0ecb4a516206d3ee34"></a><!-- doxytag: member="DummyRoute::stats" ref="aea50195938376b0ecb4a516206d3ee34" args="" -->
bool&#160;</td><td class="memItemRight" valign="bottom"><b>stats</b></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a1ee9a47507fb8d271f78c2573bda771c"></a><!-- doxytag: member="DummyRoute::trace" ref="a1ee9a47507fb8d271f78c2573bda771c" args="" -->
bool&#160;</td><td class="memItemRight" valign="bottom"><b>trace</b></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ae713377eb6d39ea996474b063976c42b"></a><!-- doxytag: member="DummyRoute::networkID" ref="ae713377eb6d39ea996474b063976c42b" args="" -->
int&#160;</td><td class="memItemRight" valign="bottom"><b>networkID</b></td></tr>
</table>
<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
<div class="textblock"><p>Placeholder module that simply "translates" netwControlInfo to macControlInfo. </p>
<dl class="author"><dt><b>Author:</b></dt><dd>Jerome Rousselot </dd></dl>
</div><hr/><h2>Member Function Documentation</h2>
<a class="anchor" id="a20ab170f205c2834e998b7bbf91043c0"></a><!-- doxytag: member="DummyRoute::encapsMsg" ref="a20ab170f205c2834e998b7bbf91043c0" args="(cPacket *appPkt)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="a00028.html#a70ef917f412c70e361b698d6989e677f">DummyRoute::netwpkt_ptr_t</a> DummyRoute::encapsMsg </td>
          <td>(</td>
          <td class="paramtype">cPacket *&#160;</td>
          <td class="paramname"><em>appPkt</em></td><td>)</td>
          <td><code> [protected, virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Encapsulate higher layer packet into an NetwPkt. </p>
<p>Encapsulates the received ApplPkt into a NetwPkt and set all needed header fields. </p>

<p>Reimplemented from <a class="el" href="a00028.html#aad9d232f77fa033ffa2f1e7abe8e4af6">BaseNetwLayer</a>.</p>

<p>References <a class="el" href="a00028.html#a57d8927211b7979cf801038333ffdd50">BaseNetwLayer::arp</a>, <a class="el" href="a00155.html#a75c4c6c2073fcd17b73583b7243e8d21">NetwControlInfo::getAddressFromControlInfo()</a>, <a class="el" href="a00015.html#a793bf2888740e48020eacbceaac211c2">ArpInterface::getMacAddr()</a>, <a class="el" href="a00028.html#a9b802bd94a739e6202690d743ecc83a2">BaseNetwLayer::headerLength</a>, <a class="el" href="a00117.html#a97a5c1c1f73f4255cabc4e292c4ad503">LAddress::isL3Broadcast()</a>, <a class="el" href="a00117.html#a9f975ad0433f1fb8a01164f266a41f62">LAddress::L2BROADCAST</a>, <a class="el" href="a00117.html#a11d63e8d897e072ed94da77028d38f60">LAddress::L3BROADCAST</a>, <a class="el" href="a00028.html#a7df0d33fcf757b2e63af619f28bf3312">BaseNetwLayer::myNetwAddr</a>, and <a class="el" href="a00028.html#a627a9f853785bc061b1423ac6ad9ad21">BaseNetwLayer::setDownControlInfo()</a>.</p>

<p>Referenced by <a class="el" href="a00089.html#afd462238bd49ed699157a22acc4b4d15">handleUpperMsg()</a>.</p>
<div class="fragment"><pre class="fragment">                                                             {
    <a class="code" href="a00117.html#aea56b60dcb5ae8c2bde465271daf7210" title="Type definition for a L2 (MAC) address.">LAddress::L2Type</a> macAddr;
    <a class="code" href="a00117.html#ad85cd9e8d9e7e9cd5d02dd740c4a12a4" title="Type definition for a L3 (Network) address.">LAddress::L3Type</a> netwAddr;

    debugEV &lt;&lt;<span class="stringliteral">&quot;in encaps...\n&quot;</span>;

    DummyRoutePkt *pkt = <span class="keyword">new</span> DummyRoutePkt(appPkt-&gt;getName(), appPkt-&gt;getKind());
    pkt-&gt;setBitLength(<a class="code" href="a00028.html#a9b802bd94a739e6202690d743ecc83a2" title="Length of the NetwPkt header Read from omnetpp.ini.">headerLength</a>);

    cObject* cInfo = appPkt-&gt;removeControlInfo();

    <span class="keywordflow">if</span>(cInfo == NULL){
    EV &lt;&lt; <span class="stringliteral">&quot;warning: Application layer did not specifiy a destination L3 address\n&quot;</span>
     &lt;&lt; <span class="stringliteral">&quot;\tusing broadcast address instead\n&quot;</span>;
    netwAddr = <a class="code" href="a00117.html#a11d63e8d897e072ed94da77028d38f60" title="Broadcast address for L3 addresses.">LAddress::L3BROADCAST</a>;
    } <span class="keywordflow">else</span> {
    debugEV &lt;&lt;<span class="stringliteral">&quot;CInfo removed, netw addr=&quot;</span>&lt;&lt; <a class="code" href="a00155.html#a75c4c6c2073fcd17b73583b7243e8d21" title="extracts the address from &quot;control info&quot;.">NetwControlInfo::getAddressFromControlInfo</a>( cInfo ) &lt;&lt; endl;
    netwAddr = <a class="code" href="a00155.html#a75c4c6c2073fcd17b73583b7243e8d21" title="extracts the address from &quot;control info&quot;.">NetwControlInfo::getAddressFromControlInfo</a>( cInfo );
    <span class="keyword">delete</span> cInfo;
    }

    pkt-&gt;setNetworkID(networkID);
    pkt-&gt;setSrcAddr(<a class="code" href="a00028.html#a7df0d33fcf757b2e63af619f28bf3312" title="cached variable of my networ address">myNetwAddr</a>);
    pkt-&gt;setDestAddr(netwAddr);
    debugEV &lt;&lt; <span class="stringliteral">&quot; netw &quot;</span>&lt;&lt; <a class="code" href="a00028.html#a7df0d33fcf757b2e63af619f28bf3312" title="cached variable of my networ address">myNetwAddr</a> &lt;&lt; <span class="stringliteral">&quot; sending packet&quot;</span> &lt;&lt;endl;
    <span class="keywordflow">if</span>(<a class="code" href="a00117.html#a97a5c1c1f73f4255cabc4e292c4ad503" title="Test if a L3 address (pSrcAddr) is a broadcast address.">LAddress::isL3Broadcast</a>(netwAddr)) {
        debugEV &lt;&lt; <span class="stringliteral">&quot;sendDown: nHop=L3BROADCAST -&gt; message has to be broadcasted&quot;</span>
           &lt;&lt; <span class="stringliteral">&quot; -&gt; set destMac=L2BROADCAST\n&quot;</span>;
        macAddr = <a class="code" href="a00117.html#a9f975ad0433f1fb8a01164f266a41f62" title="Broadcast address for L2 addresses.">LAddress::L2BROADCAST</a>;
    }
    <span class="keywordflow">else</span>{
        debugEV &lt;&lt;<span class="stringliteral">&quot;sendDown: get the MAC address\n&quot;</span>;
        macAddr = <a class="code" href="a00028.html#a57d8927211b7979cf801038333ffdd50" title="Pointer to the arp module.">arp</a>-&gt;<a class="code" href="a00015.html#a793bf2888740e48020eacbceaac211c2" title="returns a L2 address to a given L3 address.">getMacAddr</a>(netwAddr);
    }

    <a class="code" href="a00028.html#a627a9f853785bc061b1423ac6ad9ad21" title="Attaches a &quot;control info&quot; (NetwToMac) structure (object) to the message pMsg.">setDownControlInfo</a>(pkt, macAddr);

    <span class="comment">//encapsulate the application packet</span>
    pkt-&gt;encapsulate(appPkt);
    debugEV &lt;&lt;<span class="stringliteral">&quot; pkt encapsulated\n&quot;</span>;
    <span class="keywordflow">return</span> pkt;
}
</pre></div>
</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li>D:/Projects/MiXiM/extsrc/mixim/src/modules/netw/<a class="el" href="a00448_source.html">DummyRoute.h</a></li>
<li>D:/Projects/MiXiM/extsrc/mixim/src/modules/netw/DummyRoute.cc</li>
</ul>
</div>
</div>
  <div id="nav-path" class="navpath">
    <ul>
      <li class="navelem"><a class="el" href="a00089.html">DummyRoute</a>      </li>

    <li class="footer">Generated on Tue Mar 5 2013 21:26:32 for MiXiM by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.5.1 </li>
   </ul>
 </div>


</body>
</html>
